Semiconductor storage device and method of controlling the same

ABSTRACT

A semiconductor storage device includes a first nonvolatile memory to store user data of a file, a second nonvolatile memory to store management data of the file, the second nonvolatile memory being different in type from the first nonvolatile memory, and a controller to control read/write of data with respect to the first and second nonvolatile memories.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of U.S. application Ser. No.10/926,141, Aug. 26, 2004, now U.S. Pat. No. 7,353,324, and is basedupon and claims the benefit of priority from prior Japanese PatentApplication No. 2003-338551, filed Sep. 29, 2003, the entire contents ofboth of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a semiconductor storage deviceincluding a nonvolatile memory such as a flash memory.

2. Description of the Related Art

In recent years, a flash memory card using a NAND type flash memory hasbeen used as a storage medium for various types of portable informationterminals such as a digital camera.

For the NAND type flash memory, memory cells which are disposed adjacentto each other and which share a drain and source and which are connectedin series with each other are regarded as a basic unit (NAND unit). Oneend of the series connection is connected to a bit line via a selectgate (SD(D)) and the other end thereof is connected to a source line viaa select gate (SG(S)). An aggregate of the cells connected to the sameword line constitutes a page as a basic unit of write or read, and anaggregate of the pages held between the select gate on the side of thebit line and that on the side of the source line constitutes a block.

An erase operation is basically performed by a block unit describedabove. Therefore, when rewrite occurs with respect to a part of theblock, a save operation of copying data that is not to be rewritten toanother area is required. A technique of rewrite/erase is described, forexample, in Jpn. Pat. Appln. KOKAI Publication No. 6-52691.

Moreover, a physical address on a flash memory in which data of acertain logical address exists is frequently changed. Therefore, it isnecessary to prepare a logical address/physical address conversion tablerequired for performing logical address/physical address conversionevery time. The conversion table is prepared in the following procedureat the time of power activation. That is, a redundant portion of a toppage of each block is searched, and the data of the logical addresscorresponding to the data stored in the block is confirmed. In thiscase, a logical address region of the redundant portion is read, and thelogical address/physical address conversion table is prepared based onan obtained value. A technique of the logical address/physical addressconversion table is described, for example, in Jpn. Pat. Appln. KOKAIPublication No. 10-124384.

Additionally, when a file is updated in a memory card using the NANDtype flash memory, the data of a file main body has a relatively largeamount of data, and therefore the save operation does not occur sooften. However, for data of a file management region such as a fileallocation table (FAT), directory, and subdirectory, rewrite by a sectorunit occurs with a large frequency. Therefore, there is a problem thatthe above-described save operation frequently occurs and a file rewriteperformance of a flash memory card is deteriorated. Therefore, there isa demand for presentation of a technique for enhancing the rewriteperformance of the file.

Moreover, in recent years, there is a tendency for increase of acapacity of the flash memory, and there is a problem that a preparationtime (i.e., activation time) of the logical address/physical addressconversion table is considerably long. Therefore, there is a demand forthe presentation of a technique in which even with the increase of thecapacity of the flash memory, the activation time of the conversiontable does not increase. Furthermore, there is a demand for thepresentation of a technique in which the data can be updated with asimple write algorithm without using the logical address/physicaladdress conversion table.

BRIEF SUMMARY OF THE INVENTION

Embodiments of the present invention may provide a semiconductor storagedevice and a method of controlling the device in which an efficiency ofprocessing such as rewrite of data can be enhanced with respect to anonvolatile memory.

According to one aspect of the present invention, there is provided asemiconductor storage device comprising a first nonvolatile memory tostore user data of a file; a second nonvolatile memory to storemanagement data of the file, the second nonvolatile memory beingdifferent in type from the first nonvolatile memory; and a controller tocontrol read/write of data with respect to the first and secondnonvolatile memories.

According to another aspect of the present invention, there is provideda semiconductor storage device comprising a first nonvolatile memory tostore data; a second nonvolatile memory to store address conversioninformation associating a logical address designated on a host side witha physical address on the first nonvolatile memory in whichcorresponding data is stored, the second nonvolatile memory beingdifferent in type from the first nonvolatile memory; and a controller tocontrol read/write of data with respect to the first nonvolatile memoryby referring to the address conversion information stored in the secondnonvolatile memory.

According to still another aspect of the present invention, there isprovided a semiconductor storage device comprising a first nonvolatilememory to store data; a second nonvolatile memory to store new data of aportion to be updated at a time of data update on the first nonvolatilememory and data of a portion not to be updated are temporarily stored,the second nonvolatile memory being different in type from the firstnonvolatile memory; and a controller which controls read/write of datawith respect to the first and second nonvolatile memories.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate embodiments of the invention, andtogether with the general description given above and the detaileddescription of the embodiments given below, serve to explain theprinciples of the invention.

FIG. 1 is a diagram showing a constitution example of a memory card,which is common to first to fourth embodiments of the present invention;

FIG. 2 is a diagram showing an example of another constitution differentfrom that of FIG. 1;

FIG. 3 is a diagram showing an example of another constitution differentfrom that of FIGS. 1 and 2;

FIG. 4 is a diagram showing one example of MCP;

FIG. 5 is an explanatory view of an internal constitution of a NAND typeflash memory for use in the constitution examples of FIGS. 1 to 3;

FIG. 6 is an equivalent circuit diagram of MRAM;

FIG. 7 is a sectional view schematically showing an MTJ deviceconstituting the MRAM;

FIG. 8 is a sectional view of the MRAM;

FIG. 9 is a diagram showing one example of format parameters whichdefine allocation of a storage region in the memory card according tothe first embodiment of the present invention;

FIG. 10 is a diagram showing a process in a case where there is arequest for write of user data of a file;

FIG. 11 is a diagram showing a process in a case where there is arequest for write of management data of the file;

FIG. 12 is a flowchart showing a write operation in the firstembodiment;

FIG. 13 is a diagram showing one example of a logical address/physicaladdress conversion table prepared on the MRAM according to a secondembodiment of the present invention;

FIG. 14 is a flowchart showing a read operation in the secondembodiment;

FIG. 15 is a flowchart showing a write operation in the secondembodiment;

FIG. 16 is a diagram showing an extracted part of a storage region ofthe MRAM and that of the flash memory according to a third embodiment ofthe present invention;

FIG. 17 is a diagram showing an initial state in a write algorithm;

FIG. 18 is a diagram showing a temporary storage process in the writealgorithm;

FIG. 19 is a diagram showing a block erase process in the writealgorithm;

FIG. 20 is a diagram showing a data transfer process in the writealgorithm;

FIG. 21 is a diagram showing a constitution example of the memory cardin which a peak value of a current at the time of the write of the datainto the MRAM is reduced;

FIG. 22 is a flowchart showing a method of reducing power consumption ofthe whole system; and

FIG. 23 is a flowchart showing another method of reducing the powerconsumption of the whole system.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of the present invention will hereinafter be described withreference to the drawings.

Constitution Common to First to Fourth Embodiments

FIG. 1 is a diagram showing a constitution example of a memory card,which is common to first to fourth embodiments of the present invention.FIG. 2 is a diagram showing an example of another constitution differentfrom that of FIG. 1. FIG. 3 is a diagram showing an example of stillanother constitution different from that of FIGS. 1 and 2.

Each memory card 10 shown in FIGS. 1 to 3 include common elements suchas: a plurality of NAND type flash memories 1, 2 for storing data (userdata) of a file main body; a controller 3 for controlling communicationwith a host side, read/write of data with respect to the flash memories1, 2, data transfer between various types of memories, and the like; anda CPU 4 for use by the controller 3. Furthermore, each memory card 10includes one or a plurality of magnetic random access memories (MRAM) 5,but a place of arrangement differs with the constitution example.Moreover, this MRAM differs in application depending on each embodiment.

In the constitution example of FIG. 1, the MRAM 5 is mixed/mounted inthe controller 3 in the memory card 10. The mixing/mounting hereinincludes, needless to say, the mixing/mounting on the same chip, andalso includes, for example, the stacking in one package by an assemblytechnique of the package such as a multi chip package (MCP) shown inFIG. 4. The MRAM is a storage device using a tunneling magneto resistive(TMR) effect to store data. The device also includes characteristicssuch as non-volatility by which the data is not lost even withdisconnection of a power source, a high read/write rate, and highintegration. However, there is a problem in cost, and it is difficult toconstitute the whole memory card 10 by the MRAM. Therefore, here theMRAM 5 having a relatively small capacity is mixed/mounted in thecontroller.

In the constitution example of FIG. 2, the MRAM 5 is not mixed/mountedin the controller 3, but the MRAM 5 having a relatively small capacityis mounted in the memory card 10 separately from the flash memories 1, 2for storing the user data.

In the constitution example of FIG. 3, MRAM 5A, 5B having relativelysmall capacities are mixed/mounted in the flash memories 1, 2,respectively. Also in this case, each MRAM may also be stacked in onepackage by the assembly technique of the package as in the multi chippackage (MCP) shown in FIG. 4.

Any of the above-described constitution examples is common in that theMRAM having the relatively small capacity is disposed in the memory card10 separately from the flash memories 1, 2 in which the user data isstored. The memories such as SRAM/DRAM may also collectively be disposedin the memory card separately from the MRAM.

Next, an internal constitution of the NAND type flash memory for use inthe constitution examples of FIGS. 1 to 3 will be described withreference to FIG. 5.

For the NAND type flash memory, memory cells which are disposed adjacentto each other and which share a drain and source and which are connectedin series with each other are regarded as a basic unit (NAND unit). Oneend of the series connection is connected to a bit line via a selectgate (SD(D)) and the other end thereof is connected to a source line viaa select gate (SG(S)). The basic units (NAND units) are integrated in aword line direction to constitute a page as a basic unit of write orread. An aggregate of the pages held between the bit line and sourceline constitutes a block. In a shown example, 16 pages constitute oneblock. Data length of one page is 528 bytes. Among these, 512 bytesconstitute a user data region, and remaining 16 bytes constitute aredundant portion. The redundant portion is used to store a code forerror correction (ECC) with respect to the user data of 512 bytes, alogical address, a flag indicating a status of the block, and the like.

Next, the constitution of the MRAM will be described with reference toFIGS. 6 to 8.

FIG. 6 shows an equivalent circuit diagram of the MRAM. FIG. 7schematically shows a magnetic tunnel junction (MTJ) device constitutingthe MRAM.

As shown in FIG. 7, a bit line 21 is disposed so as to cross at rightangles to word lines 19, 26, and an MTJ device 20 is disposed in anintersection of the bit line 21 with the write word line 19. One end ofthe MTJ device 20 is conversion table the bit line 21, and the other endthereof is conversion table a transistor 13. Moreover, a gate electrodeof this transistor 13 constitutes the read word line 26.

The MTJ device 20 includes a three-layer structure including twomagnetic layers and a non-magnetic layer held between the magneticlayers. That is, as shown in FIG. 7, the MTJ device 20 is constitutedof: a magnetization fixed layer 41 connected to a lower electrode 17; amagnetic recording layer 43 connected to the bit line 21 via an upperelectrode (not shown); and a thin tunnel junction layer 42 held betweenthe magnetization fixed layer 41 and the magnetic recording layer 43.

Here, the magnetization fixed layer 41 is constituted of anantiferromagnetic layer and ferromagnetic layer. Since magnetization isfixed in one direction, the layer is called a pinned layer. On the otherhand, the magnetic recording layer 43 is constituted of theferromagnetic layer. Since the magnetization direction can freely bechanged and information is stored, the layer is called a memory layer.The magnetization direction of the magnetic recording layer 43 can bechanged by a synthesized magnetic field formed by a current flowingthrough the bit line 21 and that flowing through the write word line 19.

FIG. 8 shows a sectional view of the MRAM. As shown in FIG. 8, forexample, in a P-type semiconductor substrate (or a well) 11, a deviceisolation region 12 including a shallow trench isolation (STI) structureis selectively formed. A MOSFET 13 is selectively formed on thesemiconductor substrate 11 and, for example, N-type source/drain regions14 are formed under opposite ends of the MOSFET 13. Here, a gateelectrode of the MOSFET 13 constitutes the read word line 26. Further onthe semiconductor substrate 11, first contacts 16 a connected to thesource/drain regions 14 are disposed in an insulating film 15, and firstwirings 17 a are disposed on the first contacts 16 a. Similarly, in theinsulating film 15, second to fourth contacts 16 b, 16 c, 16 d andsecond to fourth wirings 17 b, 17 c, 17 d are disposed. Here, some ofthe first wirings 17 a constitute ground (Gnd) lines 18. Some of thethird wirings 17 c constitute write word lines 19 a, 19 b, 19 c.Moreover, the fourth wirings 17 d are connected to the MTJ devices 20,and the MTJ devices 20 are connected to the bit line 21.

Next, a write/read operation of data in the MRAM will briefly bedescribed.

First, to write “1”, “0” information into the MTJ devices 20, one pairof write word line 19 and bit line 21 are selected. The current ispassed through both the selected write word line 19 and bit line 21 togenerate current magnetic fields. Accordingly, the magnetic field isapplied to a selection cell positioned in an intersection of the writeword line 19 and bit line 21, and the information is written exceeding areverse threshold value of the magnetization of the MTJ devices 20 bythe magnetic field.

In this case, for example, when the magnetization direction of themagnetization fixed layer 41 extends in parallel with that of themagnetic recording layer 43, the current is passed through the tunneljunction layer 42. Accordingly, a detected tunnel resistance becomeslowest, and “1” can be stored in this state. On the other hand, when themagnetization direction of the magnetization fixed layer 41 extends inantiparallel with that of the magnetic recording layer 43, the currentis passed through the tunnel junction layer 42, the detected tunnelresistance accordingly becomes highest, and “0” can be stored in thisstate. That is, in the MRAM, a difference between the tunnel resistancesis stored as the “1”, “0” information.

On the other hand, to read the “1”, “0” information written in the MTJdevices 20, when the read word line 26 and bit line 21 are selected, thecurrent flows through the Gnd lines 18 from the bit line 21 via the MTJdevices 20 and MOSFET 13. Moreover, a peripheral circuit reads thedifference of the tunnel resistance between the different MTJ devices 20as the information, and accordingly executes determination of the “1”,“0” information.

First Embodiment

In a first embodiment, the MRAM 5 is disposed inside the controller 3,FAT or directory region is stored in the MRAM 5, and a write rate isprevented from dropping with the rewrite by the sector unit such as therewrite of the FAT and directory generated at the time of file update.

FIG. 9 shows one example of format parameters which define allocation ofa storage region in the memory card 10. The information of FIG. 9 isstored in a predetermined region to which the controller 3 can refer.Here, an example in which cluster sizes are 4 KB and 8 KB is shown.

A cluster is a basic minimum unit of file management. Even when a filesize is very small, a capacity for one cluster is occupied. When thesize of the file is large, the file is managed as a chain of a pluralityof clusters, and management information is stored in the file allocationtable (FAT). The size of the cluster, a method of managing the FAT, andthe like are managed in a sector called a boot sector. When one deviceis managed as a plurality of drives, the information is stored in amaster boot sector.

For the write of the file, a write command is used from OS by a clusterunit.

When the cluster size is 4 KB, the master boot sector is disposed in alogical sector 0, the boot sector is disposed in a logical sector 19,FAT1 (original FAT) is disposed logical sectors 20 to 25, FAT2 (copy ofFAT) is disposed in logical sectors 26 to 31, directories are disposedin logical sectors 32 to 47, and a user data region of the file isdisposed in a logical sector 48 and subsequent sectors.

When the cluster size is 8 KB, the master boot sector is disposed in thelogical sector 0, the boot sector is disposed in the logical sector 25,FAT1 (original FAT) is disposed the logical sectors 26 to 28, FAT2 (copyof FAT) is disposed in the logical sectors 29 to 31, the directories aredisposed in the logical sectors 32 to 47, and the user data region ofthe file is disposed in the logical sector 48 and subsequent sectors.

The format parameters shown in FIG. 9 are described in order of alogical sector address. A host system makes an access based on thelogical sector address, and a physical address on the flash memory inthe memory card 10 where the data exists in actual depends on control ofthe controller 3.

In a constitution of prior art, all data of the management data region(logical sectors 0 to 47) and user data region (logical sectors 48 to63) are allocated to the flash memory. On the other hand, in theconstitution of the present embodiment, the user data region of the file(logical sectors 48 to 63) is allocated to the flash memory, whereas themanagement data region of the file (logical sectors 0 to 47) isallocated to the MRAM 5.

Next, a write process in the memory card 10 of FIG. 1 will be describedwith reference to FIGS. 10 and 11.

It is to be noted that it is assumed that the management data of thefile is stored beforehand on the MRAM 5 in the controller 3 of thememory card 10. Moreover, user data may also be stored beforehand on theflash memories 1, 2, if necessary.

A case is considered in which a request for write including “data of thefile main body” (user data) comes from host through a host interface asshown in FIG. 10. The logical address is designated in the request forwrite. At this time, the logical address is an address where the data ofthe file main body is to be stored. Then, the data is written withrespect to the flash memory (e.g., the flash memory 1). At this time,the MRAM 5 in the controller 3 functions as a data buffer, and the datafrom the host is once stored in the MRAM 5 (step A1), and thereaftertransferred to the flash memory 1 (step A2).

On the other hand, a case is considered in which the request for writeincluding “FAT, directory data, and the like” (management data of thefile) comes from the host through the host interface as shown in FIG.11. For the logical address, the FAT, directory, and the like correspondto the file management region. In this case, the management data on theMRAM 5 is updated (step A3).

The controller in the conventional memory cell only writes thedesignated data based on the address designated by the host, and doesnot identify the data of the user data region or the management dataregion. On the other hand, the controller 3 in the present embodimentcan determine that the designated data is the data of the user dataregion or the management data region based on the address designatedfrom the host.

Additionally, the logical address in which the management data of thefile is stored changes with the parameters of the format (e.g., thecapacity, the total number of entries of a root directory, the size ofthe cluster, and the like). Therefore, in the present embodiment, forexample, the following judgment criteria are disposed.

That is, in consideration of the capacity of the MRAM 5 mixed/mounted inthe controller 3, and the format parameters that can usually be set, thelogical address region for storing the management data of the file isset beforehand, for example, so that the logical addresses 0 to 47 areallocated to the management data region of the file. When the logicaladdress in this range is designated from the host, the controller 3detects an access to the file management region.

It is to be noted that here the logical address 0 and subsequent logicaladdresses do not have to be necessarily allocated to the management dataregion. Usually, a frequency of rewrite of the master boot sector in thelogical address 0 is considered to be very small. Moreover, thefrequency of the rewrite of the logical addresses between the masterboot sector and a partition boot sector is also very small. Therefore,the region of the logical addresses 0 to 15 corresponding to one blockof the flash memory may also be excluded from the management data regionof the file. In this case, the capacity of the MRAM can be reduced. As aresult, it is possible to reduce cost for the MRAM.

Here, a case is considered in which re-formatting is executed in apersonal computer (PC), digital camera, and the like and the formatparameters are changed. In this case, when a boundary between themanagement data region and user data region of the file deviates in adirection of a small value of the logical address, a part of the userdata is also stored in the MRAM, and there is not any problem.

When the boundary between the management data region and user dataregion of the file deviates in a direction of a large value of thelogical address, a part of the file management data includes a rewritealgorithm similar to that of the usual user data, and an effect ofinhibiting performance from being deteriorated is not fulfilled at themaximum. However, it cannot usually be assumed that the parameter is fardifferent from the assumed parameter. Therefore, at least a certaindegree of the data of the management data region is stored on the MRAM5, and an effect of enhancing the performance can be expected. It is tobe noted that the controller 3 may also be constituted to decipher thedata by itself and to understand the format parameters and todynamically set a logical address range of the file management region.

Next, a write operation in the present embodiment will be described withreference to FIG. 12.

Upon receiving the request for write from the host (step S11), thecontroller 3 refers to the information of FIG. 9 to confirm the logicaladdress designated by the host, and determines whether the data to bewritten corresponds to the management data of the file or the user data(step S12). When the data corresponds to the management data of thefile, the data is written in the MRAM 5 (step S13). On the other hand,when the data corresponds to the user data (data of the file main body),the data is written in the corresponding flash memory 1 or 2 (step S14).

In this manner, in the first embodiment, the MRAM 5 is disposed in thecontroller 3, and the FAT or directory region is stored in the MRAM 5,the write rate is prevented from dropping with the rewrite by the sectorunit such as the rewrite of the FAT and directory generated at the timeof the file update.

Second Embodiment

In a second embodiment, the MRAM 5 is disposed in the controller 3, anda logical address/physical address conversion table (allocation table)in which the logical address designated on the host side is associatedwith the physical address on the flash memory is stored in the MRAM 5,so that a time for preparing the logical address/physical addressconversion table which has heretofore been prepared at the time of poweractivation is reduced.

FIG. 13 shows one example of the logical address/physical addressconversion table prepared on the MRAM 5.

Here, two bytes (one word) are regarded as one unit, and conversion ofthe logical and physical addresses is managed. For example, offset 0(i.e., word 0 which is a top word, when the table is prepared from thetop of the MRAM region) includes physical address information(high-order address, low-order address) indicating the physical addressin which the data of the logical address 0 (i.e., LBA=0) exists. In thepresent embodiment, an example of the NAND type flash memory whose oneblock corresponds to 8K bytes is described, and a physical block addressis stored in which the data for 16 sectors of the logical sectors 0 to15 (it is assumed that one sector=512 bytes, and additionally, the sizeis not limited to 512 bytes) exists.

It is to be noted that when the data corresponding to the logicaladdress does not exist on the flash memory immediately after productshipping or initialization, the corresponding word region is filled withFFh.

Next, a read operation in the present embodiment will be described withreference to FIG. 14. This read operation is executed by the controller3.

In the present embodiment, the logical address/physical addressconversion table is present on the MRAM 5. For characteristics, the MRAMis nonvolatile and random accessible. Therefore, different from theprior art, it is not necessary to search for the redundant portions ofall the blocks at the time of the power activation or to prepare thelogical address/physical address conversion table.

First, a top sector address from which the data is to be read, and thenumber of transfer sectors are received from the host (step S21), and itis verified whether or not a range is appropriate (step S22). When therange is not appropriate, ID cannot be confirmed. On the other hand,when the range is appropriate, the sector address is converted to thelogical block address (logical address), and the number of pages in theblock is calculated (step S23). For example, in the present embodiment,since one block is constituted of 16 sectors, the value of each sectoraddress is divided by 16. Moreover, the logical address/physical addressconversion table on the MRAM 5 is referred to, and the physical blockaddress in which the corresponding logical block exists is obtained(step S24).

Here, the data for one sector is read from a specified physical block(step S25). For example, when the sector number is 0, the data of thetop page of the physical block is read. In one physical block, the datafor 16 sectors are arranged in order.

It is checked whether or not there is an error with respect to the readdata (step S26). When the error is not detected, the flow advances tostep S29. On the other hand, when the error is detected, it isdetermined whether or not the error is correctable (step S27). The errorthat is not correctable is processed as the error. On the other hand,when the error is detected, and is further correctable, the data iscorrected (step S28).

Here, it is determined whether or not the number of sectors required bythe host have been read (final sector has been reached) (step S29). Whenthe final sector is reached, the process is ended. On the other hand,when the final sector is not reached, it is determined whether or notthe next read sector exceeds the boundary of the physical block (stepS30). At this time, if necessary, the logical address/physical addressconversion table is referred to again.

When the boundary is not crossed over, the pages to be read are countedup (step S31), and the read is continued in the same block. On the otherhand, when the boundary is crossed over, the physical block address(physical address) is counted up, the count of pages is reset (stepS32), and the process shifts that concerning another block.

Next, the write operation in the present embodiment will be describedwith reference to FIG. 15. The write operation is executed by thecontroller 3.

It is to be noted that the write process is basically roughly dividedinto the next three parts. For example, a case in which the logicalsector 3 is to be rewritten will be described. In this case, an objectof update includes only sector 3. However, since the data for 16 sectorsof the sectors 0 to 15 exists on the same block, the process for oneblock is required.

(1) Regarding logical sectors 0, 1, and 2, there is not any update ofthe data. Therefore, the data of the logical sectors 0, 1, and 2 needsto be copied to the physical block where the data is to be newly writtenfrom the physical block where the data is originally stored.

(2) Since the logical sector 3 is updated, the original data does nothave to be copied, and the data supplied from the host is newly written.

(3) For the logical sectors 4 to 15, there is not any update of thedata. Therefore, the data of the logical sectors 4 to 15 needs to becopied to the physical block where the data is to be newly written fromthe physical block where the data is originally stored.

In this manner, a series operation of copying the data with respect toone block, next writing update data, and next copying the data isbasically performed. When the data is written into sectors 0 to 15, allthe data for one block is updated. Therefore, needless to say, the copyoperation is not required.

Each determination section in the flowchart of FIG. 15 corresponds to aprocess of determining whether the sector to be written is the updateddata or the copy operation.

First, the top sector address in which the data is to be updated, andthe number of transfer sectors are received from the host (step S41),and a process of converting the sector address to a logical blockaddress (logical address) is performed. That is, the logical blockaddress is calculated from the top sector address, and the physicaladdress of the block in which the data exists is extracted from thelogical address/physical address conversion table on the MRAM 5 (stepS42). Here, the data to be copied is drawn from the selected block.

The process is started from the top of the physical block correspondingto the top address of the calculated logical block address (step S43).Here, it is determined whether the copy operation is performed withrespect to a former half of the block or the data is updated (step S44).In the copy operation, the data is read from the original block andwritten into the new block (step S45), and the process shifts to thatfor the next sector (step S46). On the other hand, in the updateoperation, the data is written based on the update data received fromthe host (step S47), and the process shifts to that for the next sector(step S48).

It is determined whether or not the data has been written for the numberof sectors required by the host (step S49). When the write for thenumber of required sectors is ended, it is determined whether or not theboundary of the block has been reached (step S50). When the boundary ofthe block is not reached, a region for the write remains. Therefore, theoperation shifts to a copy operation for a latter half of the block.That is, the data is read from the original block and written into thenew block (step S51), and the process shifts to that for the next sector(step S52). On the other hand, when the block boundary is reached, thecopy operation does not have to be executed any more. Therefore, basedon a result of the write, the logical address/physical addressconversion table on the MRAM 5 is updated, further the physical block inwhich the data has originally existed is erased, and a new write regionin the next process is registered as a candidate region (step S54), andthe process is ended.

When the write for the number of sectors required by the host is notended in the step S49, it is determined whether or not the boundary ofthe block has been reached (step S53). When the boundary of the block isnot reached, further write is necessary, and therefore the processadvances to step S47. On the other hand, when the boundary of the blockis reached, the process shifts to that for the next physical block.Before shifting to the next block process, the logical address/physicaladdress conversion table on the MRAM 5 is updated based on the result ofthe performed write. Furthermore, the physical block in which theoriginal data has existed is erased, and the new write region in thenext process is registered as the candidate region (step S54), theprocess shifts to that for the next block (step S55), and the processadvances to step S42.

As described above, the write process is performed with respect to theflash memory. Moreover, at the time of the next power activation, thelogical address/physical address conversion table already exists on theMRAM 5. Therefore, different from the prior art, it is not necessary tosearch for the redundant portions of all the blocks or to prepare thelogical address/physical address conversion table.

In the present embodiment, the logical address information is stored inthe redundant portions of the NAND type flash memories 1, 2, but thelogical address information does not have to be necessarily stored. Thelogical address/physical address conversion table exists on the MRAM 5,and the logical address/physical address conversion table does not haveto be prepared at the time of the power activation as in the prior art.Therefore, unless the logical address of the redundant portion isstored, there is not any problem. Additionally, considering from powercut during the update of the conversion table on the MRAM 5, in anassurance sense, logical address data preferably exists in the redundantportions of the flash memories 1, 2.

Moreover, the flash memory includes a congenitally defective blockalready unusable in a shipping stage, and an acquired defective blockgenerated by collapse caused in a memory cell during the use, and flagsare written in the redundant portions of the flash memory. Theinformation of the defective block may also be stored on the MRAM 5. Inthis case, even when the data on the flash memory is erased by mistake,the data remains on the MRAM 5. Therefore, the data can be referred to.

Moreover, the table of the erased block may also be stored on the MRAM5. For example, one bit is allotted to one block. When the bit indicates“1”, the erased block is identified. When the bit indicates “0”, a blockin which the data of a certain logical address is stored is identified.When the table is stored on the MRAM 5, the block in which the data isnext to be written can easily be found, and the performance is enhanced.

Moreover, firmware of the controller of the flash memory card may alsobe stored on the MRAM 5. Usually, the firmware is formed by a mask ROM,but bugs are generated, and a necessity for correction occurs.Considering this, all or a part of the firmware is written beforehand onthe MRAM 5. Then, a test command, and the like can be used from theoutside to upgrade a version of the firmware.

Moreover, the MRAM 5 is not limited to the storage of the logicaladdress/physical address conversion table, and can also be used as abuffer of the data written from the host or the data read into the host.

As described above, in the second embodiment, the MRAM 5 is disposed inthe controller 3, and the logical address/physical address conversiontable in which the logical address designated on the host side isassociated with the physical address on the flash memory is stored inthe MRAM 5. Accordingly, the time for preparing the logicaladdress/physical address conversion table which has heretofore beenprepared at the time of the power activation can be reduced.

Third Embodiment

In this third embodiment, the MRAM 5 is disposed in the controller 3,and the MRAM 5 is used as a nonvolatile buffer for holding the data atthe time of data update, so that write algorithm is simplified and thelogical address/physical address conversion table is not required.

FIG. 16 is a diagram showing an extracted part of a storage region ofthe MRAM 5 and that of the flash memory 1 (or 2) in the memory card 10shown in FIGS. 1 to 3. To simplify the description, it is assumed thatone block is constituted of four pages (one page is assumed tocorrespond to one sector, that is, 512 bytes, and in actual there isdata for ECC as described above, but the data is not handled here).

As shown, the MRAM 5 includes buffers A, B which are data buffers forexchanging the data mainly with the host, and buffers 0 to 3 which arebuffers for saving the data of the flash memory. Each of the buffers A,B, 0, 1, 2, 3 is assumed to be constituted of 512 bytes in the samemanner as in the page size of the flash memory (the description of thebytes of ECC is omitted as described above). Moreover, the flash memoryincludes blocks 1 to 7, and the block 3 is constituted of pages 0 to 3.

Here, one example of the write algorithm executed between the MRAM 5 andflash memory in FIG. 16 will be described with reference to FIGS. 16 and17 to 20. The process of the write is executed by the controller 3.

FIG. 17 shows an initial state. In this state, the data of logicalsector 12 is stored in page 0 of block 3 of the flash memory shown inFIG. 16, the data of logical sector 13 is stored in page 1, the data oflogical sector 14 is stored in page 2, and the data of logical sector 15is stored in page 3, respectively (step B1).

FIG. 18 shows a temporary storage process on the side of the MRAM 5 at atime when a request for update of the data is generated with respect tothe sector 12. New data of the logical sector 12 transferred from thehost at the time of the request for update of the data is first oncerecorded in a predetermined region (buffer A) of the MRAM 5 in thememory card 10 (step B2). Next, for the data stored in the block 3, thedata of sectors 13, 14, 15 that does not have to be updated istransferred to the MRAM 5 (step B3).

FIG. 19 shows a block erase process on the side of the flash memory.When the temporary storage process on the MRAM 5 side is completed, theblock 3 is erased (step B4).

FIG. 20 shows a data transfer process into the flash memory from theMRAM 5. When the block erase process is completed on the flash memoryside, with respect to the erased block 3, the data for update of sector13 on the MRAM 5 is transferred to the page 0 of the block 3 from thebuffer A (step B5). The data of the remaining logical sectors is writtenback onto the block physical block address of the flash memory from theMRAM 5 (step B6). Accordingly, the data update of the sector 12 iscompleted.

In the prior art, when the power supply is cut in the midst of theupdate process, the data disappears. However, according to the presentembodiment, since the necessary data remains on the MRAM 5, it ispossible to restore the data. Moreover, the block in which the data hasoriginally existed is erased to update the data. Therefore, a relationbetween the logical address and physical address is a fixed relation,and it is not necessary to prepare the logical address/physical addressconversion table. Therefore, the time for preparing the logicaladdress/physical address conversion table at the time of the poweractivation is saved, and a high-rate start can be realized.

Moreover, as a method of determining whether or not the power supply hasbeen cut during the write, the following method is considered.

A specific region of the MRAM 5 is defined as a write end flag region.For example, when the process shown in FIG. 18 ends, the flag of theregion is set to “1”. The flag is cancelled at the time of completion ofthe process shown in FIG. 20. That is, the flag is set to “0”.

If the power supply is cut in a stage of FIG. 19, and again activated,the flag remains to be “1”. It is seen that the power supply is cutduring the write operation. Therefore, in this case, the data existingon the MRAM 5 is used to continue and end the incomplete process.Needless to say, when the process is completed, the flag is naturallyreset at “0”. Moreover, the erase operation of the flash memory isgrasped alone, and the flag is set before entering the erase operation,and is reset at the time of the end of the erase operation. Such flagfor the erase operation may also be set.

Moreover, in FIGS. 16 to 20, for ease of description, the buffer for usein exchanging the data with the host is described separately from thebuffer for use in saving the data of the flash memory, but may also beconstituted in common. For example, when a region having the same sizeas that of one block of the flash memory is set on the MRAM 5, it ispossible to store both the data to be updated and the data to be held.

Furthermore, in the description of FIGS. 16 to 20, as the unit of thewrite, 512 bytes have basically be described. However, in recent years,with enlargement of the capacity of the flash memory, the unit of thewrite of the NAND type flash memory is not limited to 512 bytes, andproducts having write units, for example, of 1, 2, and 4 Kbytes (inactual the capacity of each ECC code region is added) have beenmass-produced. It is clear that the present invention can be applied forthese. In this case, the buffer size of the MRAM is adjusted to anoptimum value in accordance with the page size or block size of theflash memory.

Moreover, a sequence for receiving the write data in the MRAM 5 from thehost may also be executed simultaneously with the data transfer betweenthe flash memory and MRAM 5.

In this manner, in the third embodiment, the MRAM 5 is disposed in thecontroller 3, and the MRAM 5 is used as the nonvolatile buffer forholding the data at the time of the data update. Accordingly, the writealgorithm can be simplified, and the necessity of the logicaladdress/physical address conversion table can be obviated.

Fourth Embodiment

This fourth embodiment can appropriately be combined and implementedwith the respective constitutions described in the first to thirdembodiments.

In general, in the MRAM, a write current is large at the time of thewrite of the information into the existing memory cell. That is, tostore the information in the memory cell, by current magnetic fieldsproduced by the word and bit lines, the magnetization direction of thememory cell is reversed. At this time, a large current is required. Forexample, when the word line or bit line is constituted of copper oraluminum, a current of about 10 mA is required per memory cell. A valueis close to a disconnection limit value by electron migration. When theinformation is simultaneously written in a plurality of memory cells,the power consumption of the whole system remarkably increases.Moreover, when a coercive force of the memory cell is reduced, the writecurrent can be reduced, but by a magnetic influence from the outside,the magnetization direction of the memory cell is reversed, and there isalso possibility that reliability of the memory cell is impaired. Inthis fourth embodiment, these problems are solved.

FIG. 21 shows a constitution example of the memory card in which a peakvalue of the current at the time of the write of the data into the MRAM5 is reduced.

In this constitution example, at the time of the write of the data intothe MRAM 5, a bit width is limited, for example, to one bit. Forexample, for the flash memories 1, 2, the data is inputted/outputtedwith an eight-bit width, whereas the data is written into the MRAM 5with one bit width. For example, as shown, a parallel/serial conversioncircuit 51 is disposed between the flash memories 1, 2 and the MRAM 5.In this case, when the data is transferred into the MRAM 5 from theflash memories 1, 2, the parallel/serial conversion circuit 51parallel/serial converts the data. Moreover, the data is written intothe MRAM 5 with a bit width smaller than that of the data outputted fromthe flash memories 1, 2. Since the write into the MRAM 5 is executed,for example, every bit, it is possible to suppress the peak value of thecurrent.

It is to be noted that the bit widths of the flash memories 1, 2 andMRAM 5 are not limited to the above-described values. The bit width inthe MRAM 5 may also be changed, for example, to two bits or four bits.The bit widths of the flash memories 1, 2 may also be set, for example,to 16 bits. In this case, from a relation with the bit widths of theflash memories 1, 2, the write unit into the MRAM 5 may also be set toeight bits. That is, when the data is written into the MRAM 5 in a timedivision manner, and the peak value of the write current is suppressed,the effect can be expected.

Moreover, the constitution or disposing place of the parallel/serialconversion circuit 51 may also be changed. For example, the MRAM 5 ismounted in the controller 3 in some case, and is mounted as a separatechip outside the controller 3 in the other case. Similarly, theparallel/serial conversion circuit 51 is also mounted in the controller3, disposed between the controller 3 and external MRAM 5 (see FIG. 2),or mounted inside an MRAM chip itself, or the flash memory itselfincludes a mode of a serial output. Various cases are allowed. When thedata is written into the MRAM 5 with a value smaller than the bit widthsof the flash memories 1, 2, the scope of the present embodiment issatisfied.

Moreover, as a method of reducing the power consumption of the wholesystem, there is the following method.

For the flash memory, especially the NAND type flash memory, at the timeof the write and erase, a booster circuit for producing a high voltage(about 20 V) is activated, and the power consumption increases.Therefore, as shown in FIG. 22, at the time of the write and erase ofthe flash memories 1, 2 (when the booster circuit is activated), thecontroller 3 executes a control so as to prevent the data from beingwritten into the MRAM 5 (steps S61, S62). Then, the booster circuits inthe flash memories 1, 2 are not activated simultaneously with the writeinto the MRAM, and the power consumption of the whole system is reduced.The write and erase may be defined as “the time of operation of thebooster circuit in the flash memory”. In specifications in which thewrite and erase are notified to the outside by a ready/busy signal, a“busy state of the flash memory” may also be defined.

Moreover, as the method of reducing the power consumption of the wholesystem, there is also the following method.

For example, as shown in FIG. 23, when the data is transferred to theMRAM 5 from the flash memories 1, 2 (step S71), the controller 3compares the data to be written into the MRAM 5 (the data read from theflash memories 1, 2) with the data held by the MRAM 5 (step S72). Whenthe data is not the same, the data is written as usual (steps S73, S74).However, the same data is controlled not to be written (steps S73, S75).

For example, when the data to be written is “1”, the data of a writeobject memory cell of the MRAM 5 is read in advance. When the data is“1”, the data is not written.

If the data is “0”, “1” is written. Accordingly, in a simple probabilitycalculation, the number of write operations can be reduced to ½, thepower consumption of the system can be reduced, and this is useful inconsideration of the use of a portable information terminal.

Additionally, there is also the following method of reducing the powerconsumption of the whole system.

For example, the write data is managed by a predetermined unit asfollows. For simplicity of the description, an example in which the datais managed by a unit of eight bits will be described. Here, a reverseflag of one bit is allotted to the write data of eight bits. Forexample, it is assumed that the write data is “1111 1111”. In this case,when the data held in the MRAM 5 is “0000 0000”, eight bits have to beoriginally written, but here instead of writing eight bits, the reverseflag is set to “1”. When the data is read from the MRAM 5, and thereverse flag is set to “1”, the reverse data of the held data is assumedas correct data. In this example, the read data is “0000 0000”, but thereverse flag is “1”, and therefore the data itself is reversed to “11111111”. In actual, it is preferable to compare arbitrary write data withthe bit of the data held in the MRAM 5 and to determine whether or notto use the reverse flag. For example, when the data in the MRAM 5 is“1111 1111”, and the write data is “1111 0011”, only the bit to write“0” is written. When the data in the MRAM 5 is “1111 1111”, and thewrite data is “0000 1100”, only the bit to write “1” is rewritten to“0”, and further the reverse flag is written. Accordingly, actuallywritten data is “1111 0011”, but is reversed by the reverse flag, and“0000 1100” is correctly recognized. As described above, the number ofbits to be written into the MRAM 5 is reduced, and the power consumptionof the whole system is reduced.

Moreover, from a viewpoint of enhancement of reliability, the may bedisposed means for alleviating the influence from the external magneticfield. For example, with the memory card, a material having amagnetically shielding effect may be used in a frame, a housing, or alabel attached to the surface of the card so as to prevent themagnetization direction of the memory cell from being reversed by themagnetic influence from the outside of the MRAM 5 or to preventreliability of the memory cell from being impaired.

Moreover, a technique of error correction may also be used to secure thereliability. For example, at the time of the write of the data into theMRAM 5, a code for error correction is produced by a predetermined unit,and the data is held together with the code in the MRAM 5. Examples ofthe method of error correction include a general read/Solomon code, BCHcode, humming code, and the like. When the parallel/serial conversioncircuit is disposed as described above, the BCH code is easily handled.A method of determining only presence/absence of the error by a cyclicredundancy check (CRC) may also be used.

In this manner, in the fourth embodiment, various types of methods areintroduced to save the power consumption and to enhance the reliabilityin the use of the MRAM 5. It is to be noted that the above-describedsolution proposals of the various problems of the MRAM 5 may be carriedout alone or as a combination of a plurality of proposals.

In the above-described embodiments, a case where the MRAM is mounted hasbeen described, but the embodiments are not necessarily limited to theMRAM. For example, a ferroelectric random access memory (FeRAM) using aferroelectric material, or an ovonics unified memory (OUM) usingchalcogen compounds may also be used. Any storage device has no problemas long as the write with a small size is possible as compared with theNAND type flash memory (a device including a random access function ispreferably usable also as the buffer) and conditions of non-volatilityand no limitation on the number of write operations are satisfied.

Moreover, for the same flash memory, when at least two or more types offlash memories different in specifications are mounted, it is alsopossible to carry out the present invention in a range in which there isno practical problem. Moreover, the flash memory for use is not limitedto the NAND type flash memory. Various types of flash memories can beapplied such as a NOR type, AND type, and DINOR type.

As described above in detail, according to the present invention, it ispossible to enhance efficiencies of processes such as data update withrespect to a nonvolatile memory in a semiconductor storage device.

Additional advantages and modifications will readily occur to thoseskilled in the art. Therefore, the invention in its broader aspects isnot limited to the specific details and representative embodiments shownand described herein. Accordingly, various modifications may be madewithout departing from the spirit or scope of the general inventiveconcept as defined by the appended claims and their equivalents.

1. A memory system comprising: a first nonvolatile memory to store userdata; a second nonvolatile memory to store management data; a controllerto control read/write of data with respect to the first and secondnonvolatile memories, the controller being configured to prevent givenmanagement data from being written into the second nonvolatile memorywhen a write operation or an erase operation of user data is executedwith respect to the first nonvolatile memory; and a conversion unit toperform data conversion to write data in the second nonvolatile memorywith a bit width smaller than that of data outputted from the firstnonvolatile memory, when data is transferred from the first nonvolatilememory to the second nonvolatile memory.
 2. The memory system accordingto claim 1, wherein the second nonvolatile memory is different in typefrom the first nonvolatile memory.
 3. The memory system according toclaim 1, wherein: the first nonvolatile memory comprises a flash memory;and the second nonvolatile memory comprises at least one of a magneticrandom access memory (MRAM), a ferroelectric random access memory(FeRAM), an ovonics unified memory (OUM), and a flash memory differentin type from the first nonvolatile memory.
 4. The memory systemaccording to claim 1, wherein the first nonvolatile memory comprises abooster circuit to be activated when a write operation or an eraseoperation of user data is executed with respect to the first nonvolatilememory.
 5. The memory system according to claim 1, further comprising anoutput unit configured to output a ready/busy signal when a writeoperation or an erase operation of user data is executed with respect tothe first nonvolatile memory, the controller being configured to preventthe given management data from being written into the second nonvolatilememory when the ready/busy signal is output.
 6. The memory systemaccording to claim 1, wherein the conversion unit comprises aparallel/serial conversion unit to perform parallel/serial conversion ofdata.
 7. The memory system according to claim 1, wherein a reverse flagof one bit is allotted to write data of a plurality of bits, the reverseflag being indicative of reverse of the write data.
 8. The memory systemaccording to claim 1, further comprising a material having amagnetically shielding effect to prevent a magnetization direction of amemory cell from being reversed by magnetic influence.
 9. The memorysystem according to claim 1, wherein an error correction or a cyclicredundancy check (CRC) is executed in data writing.
 10. The memorysystem according to claim 1, wherein the first nonvolatile memory isconfigured to input data from outside or output data to outside throughthe second nonvolatile memory in which the second nonvolatile memoryfunctions as a data buffer to once store data.
 11. The memory systemaccording to claim 1, wherein the second nonvolatile memory stores alogical address/physical address conversion table in which a logicaladdress designated from outside is associated with a physical address onthe second nonvolatile memory.
 12. The memory system according to claim1, wherein: the first nonvolatile memory comprises a flash memory inwhich an erase operation is performed in unit of a block, and the secondnonvolatile memory functions as a buffer for use in saving data of thefirst nonvolatile memory, the buffer having a same size as the block ofthe first nonvolatile memory.
 13. The memory system according to claim7, wherein the reverse flag is used when the number of bits to bechanged is larger than the number of bits not to be changed with respectto data to be written to the second nonvolatile memory.
 14. The memorysystem according to claim 7, wherein the reverse flag is not used whenthe number of bits to be changed is smaller than the number of bits notto be changed with respect to data to be written to the secondnonvolatile memory.